const Net = require('../../common.js')
Page({
  data: {
    active: 1
  },
  onTapClick(e) {
    Net.data({
      active: e.currentTarget.id,
      list:[]
    })
    this.onPageInfo(e.currentTarget.id)

  },
  onLoad: function (options) {
    this.onPageInfo(1)
  },
  onPageInfo(e) {
    Net.link('v1/goodsList', {
      member_mall_id: wx.getStorageSync('store'),
      now_page: 1,
      status: e
    }, function (rep) {
      Net.data({
        list: rep.data.data.list
      });
    }, "GET")
  },
  upGoods(e) {
    var id = e.currentTarget.id,
      _this = this
    Net.link('v1/changeStatus', {
      id: id
    }, function (rep) {
      wx.showToast({
        title: '操作成功',
        icon: 'success'
      })
      _this.onPageInfo(Net.data('active'))
    })
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {}
})